<?php
define('_IN_CMS', 1);
include('inc/php/core/core.php');
if (isset($_GET['deleteUser'])) {
    $user->deleteUser($user);
    die;
}
$userdata = $user->getInfo(); // Получаем данные о пользователе
include('inc/php/html/head.php');
include('inc/php/html/nav.php');

// Голосование за пользователя
echo '
<script type="text/javascript">
var rating = '.$userdata['rating'].';
var me_id = '.$user->id.';
function vote(user_id, mark)
{
    if (user_id != window.me_id) {
        window.rating += mark;
    }
    if (window.XMLHttpRequest) {
        // code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    } else {
        // code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4 && xmlhttp.status==200) {
            document.getElementById("rating").innerHTML = window.rating;
        }
    }
    xmlhttp.open("GET","/vote.php?user_id="+user_id+"&mark="+mark, true);
    xmlhttp.send();
}
</script>
';
$user->showUserProfile($userdata, $core->url);
include('inc/php/html/footer.php');
?>
